import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { getPhones } from '@/apis/phone.js'

export const usePhoneStore = defineStore('phone', () => {
  const phones = ref([])
  async function fetchPhones() {
    phones.value = await getPhones()
  }

  fetchPhones()

  return { phones, fetchPhones }
})
